<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\BaseController;
use App\Services\Tools\CommonService;
use Illuminate\Http\Request;    //引用http请求类
use App\Exceptions\BasicException;  //引入框架异常处理类
use Illuminate\Support\Facades\Hash;    //引入hash
use App\Services\Cache\AdminCacheService;   //admin缓存
use App\Services\Tools\JwtService;    //引入JWT服务
use App\Services\Tools\FileService;   //引入文件处理类
use App\Response\Response;

class IndexController extends BaseController
{
    /**
     * @api {get} /home 后台首页-今日统计
     * @apiVersion 0.1.0
     * @apiName 后台首页-今日统计
     * @apiGroup 后台首页
     *
     * @apiSuccessExample 成功响应
     *
    {
        "code":200,
        "data":{
            "paid(已支付)":100000114.14,
            "unpaid（未支付）":2360624.7099999576,
            "user_withdraw_data（今日提现统计）":[
                {
                    "status(提现状态 1：待审核，2：通过，3：拒绝)":1,
                    "money（提现金额）":1300
                }
            ],
            "user_room_total（公开房间数）":3034,
            "register_user_total（注册用户数）":95499,
            "online_user_total（在线用户数）":3,
            "user_recharge_data（用户充值统计）":[
                {
                "type（渠道类型 1：支付宝，2：微信，3：苹果内购，4：h5支付宝，5：h5微信）":1,
                "status（充值状态 1：待支付，2：已支付）":1,
                "count（充值笔数）":133,
                "money（充值金额）":2162434.7599999844
                }
            ]
        }
    }
     *
     */
    public function index()
    {
        $statisticsData = app('repo_index')->getStatisticsData();
        return Response::sendData($statisticsData);
    }
}
